package demo4;

interface IA{
    void testA();
}
interface IB{
    void testB();
}
interface IC extends IA,IB{
    void testC();
}

class D implements IC{
    @Override
    public void testA() {

    }

    @Override
    public void testB() {

    }

    @Override
    public void testC() {

    }
}
public class Test {
    public static void main(String[] args) {
        Object dog1=new Dog("小黄",29);
        Object dog2=new Dog("小黄",29);
        System.out.println(dog1==dog2);//false
        System.out.println(dog1.equals(dog2));//true

        System.out.println(dog1.hashCode());
        System.out.println(dog2.hashCode());
    }
    public static void main3(String[] args) {
        walk(new Robot());
    }
    public static void func(Animal animal){
        animal.eat();
    }
    public static void walk(IRunning iRunning){
        iRunning.run();
    }
    public static void fly(IFly iFly){
        iFly.fly();
    }
    public static void swimming(ISwimming iSwimming){
        iSwimming.swim();
    }

    public static void main2(String[] args) {
        walk(new Duck("唐老鸭",220));
        walk(new Dog("旺财",20));
        System.out.println("===========");

        fly(new Duck("唐老鸭",220));

        System.out.println("===========");
        swimming(new Duck("唐老鸭",220));
        swimming(new Dog("旺财",20));
        swimming(new Fish("小鱼儿",20));
    }
    public static void main1(String[] args) {
        func(new Duck("唐老鸭",220));
        func(new Dog("旺财",20));
        func(new Fish("小鱼儿",20));
    }
}
